﻿using System;
using System.Collections;
using Huirui.Cavan.Domain.Seedwork;

namespace Huirui.Cavan.Domain.MainBoundedContext.SystemModule
{
    #region ManualCodeHistory

    /// <summary>
    /// ManualCodeHistory object for NHibernate mapped table 'ManualCodeHistory'.
    /// </summary>
    public class ManualCodeHistory : Persistent<long>
    {
        #region Member Variables
        protected string _code;
        protected int _codeRuleType;
        protected int _codeType;

        #endregion

        #region Constructors

        public ManualCodeHistory() { }

        public ManualCodeHistory(string code, int codeRuleType, int codeType, DateTime createDate, DateTime modifyDate, int editUser, byte[] version)
        {
            this._code = code;
            this._codeRuleType = codeRuleType;
            this._codeType = codeType;
            this._createDate = createDate;
            this._modifyDate = modifyDate;
            this._editUser = editUser;
            this._version = version;
        }

        #endregion

        #region Public Properties

        public virtual string Code
        {
            get { return _code; }
            set
            {
                if (value != null && value.Length > 20)
                    throw new ArgumentOutOfRangeException("Invalid value for Code", value, value.ToString());
                _code = value;
            }
        }

        public virtual int CodeRuleType
        {
            get { return _codeRuleType; }
            set { _codeRuleType = value; }
        }

        public virtual int CodeType
        {
            get { return _codeType; }
            set { _codeType = value; }
        }


        #endregion
    }
    #endregion
}